#ifndef _ENTRY_POINT_H_
#define _ENTRY_POINT_H_

#include "application.h"

int main(int argc, char *argv[])
{
    //创建一个引擎程序
    //该引擎维护所有的对象
    Application *app = CreateApplication();
    //创建完毕以后必须初始化，如果没有初始化引擎会丢失一些核心对象
    //这会导致整个程序运行错误
    if (Application::Initialize(argc, argv, app) != 0)
    {
        //
        std::cout << "Engine Enviroment Initial Failure" << std::endl;
        return -1;
    }
    app->onCreated();

    while (Application::window->IsWindowActive())
    {
        Application::window->ClearBuffer();
        // Todo...
        //=========================================
        Application::window->__test_draw();
        //=========================================
        Application::window->ProcEvent();
        app->onInput();
        Application::window->SwapBuffer();
    }

    app->onDestroy();
    delete app;
    return 0;
}

#endif